package com.laamella.syntherface.synths.gui;

import com.laamella.syntherface.synths.events.EventListener;
import com.laamella.syntherface.synths.events.SynthWideEvents;
import com.laamella.syntherface.synths.midi.MidiInterface;

import javax.swing.JTextField;

/**
 * After adding this to a panel, make sure to register it as the
 * statusDisplayListener on {@link MidiInterface}.
 * 
 * @author danny
 * 
 */
@SuppressWarnings("serial") public class StatusDisplay extends JTextField {

	public StatusDisplay() {
		super();
		SynthWideEvents.statusUpdate().listeners.add(new EventListener<String>() {
			@Override public void onEvent(String event) {
				setText(event);
			}
		});
	}
}
